Autogenerated HTML docs for v2.19.0-216-g2d3b1c
diff --git a/git-fetch.html b/git-fetch.html index 592bb44..906a062 100644 --- a/git-fetch.html +++ b/git-fetch.html
@@ -908,11 +908,10 @@ </dt> <dd> <p> - When <em>git fetch</em> is used with <code><rbranch>:<lbranch></code> - refspec, it refuses to update the local branch - <code><lbranch></code> unless the remote branch <code><rbranch></code> it - fetches is a descendant of <code><lbranch></code>. This option - overrides that check. + When <em>git fetch</em> is used with <code><src>:<dst></code> refspec it may + refuse to update the local branch as discussed + in the <code><refspec></code> part below. + This option overrides that check. </p> </dd> <dt class="hdlist1"> @@ -1217,11 +1216,35 @@ <div class="paragraph"><p><code>tag <tag></code> means the same as <code>refs/tags/<tag>:refs/tags/<tag></code>; it requests fetching everything up to the given tag.</p></div> <div class="paragraph"><p>The remote ref that matches <src> -is fetched, and if <dst> is not an empty string, the local -ref that matches it is fast-forwarded using <src>. -If the optional plus <code>+</code> is used, the local ref -is updated even if it does not result in a fast-forward -update.</p></div> +is fetched, and if <dst> is not an empty string, an attempt +is made to update the local ref that matches it.</p></div> +<div class="paragraph"><p>Whether that update is allowed without <code>--force</code> depends on the ref +namespace it’s being fetched to, the type of object being fetched, and +whether the update is considered to be a fast-forward. Generally, the +same rules apply for fetching as when pushing, see the <code><refspec>...</code> +section of <a href="git-push.html">git-push(1)</a> for what those are. Exceptions to those +rules particular to <em>git fetch</em> are noted below.</p></div> +<div class="paragraph"><p>Until Git version 2.20, and unlike when pushing with +<a href="git-push.html">git-push(1)</a>, any updates to <code>refs/tags/*</code> would be accepted +without <code>+</code> in the refspec (or <code>--force</code>). The receiving promiscuously +considered all tag updates from a remote to be forced fetches. Since +Git version 2.20, fetching to update <code>refs/tags/*</code> work the same way +as when pushing. I.e. any updates will be rejected without <code>+</code> in the +refspec (or <code>--force</code>).</p></div> +<div class="paragraph"><p>Unlike when pushing with <a href="git-push.html">git-push(1)</a>, any updates outside of +<code>refs/{tags,heads}/*</code> will be accepted without <code>+</code> in the refspec (or +<code>--force</code>), whether that’s swapping e.g. a tree object for a blob, or +a commit for another commit that’s doesn’t have the previous commit as +an ancestor etc.</p></div> +<div class="paragraph"><p>Unlike when pushing with <a href="git-push.html">git-push(1)</a>, there is no +configuration which’ll amend these rules, and nothing like a +<code>pre-fetch</code> hook analogous to the <code>pre-receive</code> hook.</p></div> +<div class="paragraph"><p>As with pushing with <a href="git-push.html">git-push(1)</a>, all of the rules described +above about what’s not allowed as an update can be overridden by +adding an the optional leading <code>+</code> to a refspec (or using <code>--force</code> +command line option). The only exception to this is that no amount of +forcing will make the <code>refs/heads/*</code> namespace accept a non-commit +object.</p></div> <div class="admonitionblock"> <table><tr> <td class="icon">